package com.freshcity.manager
{
	import com.freshcity.component.guide.LineBox;
	import com.freshcity.lib.util.ObjectPool;
	import com.freshcity.manager.support.LoadEffect;
	import com.freshcity.manager.support.MsgRollTipsImpl;
	import com.freshcity.manager.support.UIMaskEffect;
	import com.greensock.TweenLite;
	import com.pblabs.core.IPBManager;
	
	import flash.display.DisplayObjectContainer;
	import flash.geom.Point;

	public class EffectManager implements IPBManager
	{
		[Inject]
		public var layerManager:LayerManager;
		
		private static var _uiMaskEffect:UIMaskEffect;
		private static var _lineBox:LineBox;
		private static var _loadEffect:LoadEffect;

		public function initialize():void
		{
			_uiMaskEffect = new UIMaskEffect(LayerManager.topLayer);
			_loadEffect = new LoadEffect();
		}
		
		public function destroy():void
		{
			// TODO Auto Generated method stub
		}
		
		public static function addUIMask(maskInfos:Array, timeout:int=10000,isShow:Boolean=false):void
		{
			_uiMaskEffect.showMask(maskInfos, timeout,isShow);
		}
		
		public static function hideUIMask():void
		{
			_uiMaskEffect.hideMask();
		}
		
		public static function addLoadMask(arg1:DisplayObjectContainer=null):void
		{
			_loadEffect.show(arg1);
		}
		
		public static function hideLoadMask():void
		{
			_loadEffect.hide();
		}		
		
		public static function hasUIMask():Boolean
		{
			return !_uiMaskEffect.isHide;
		}
		
		public static function stageResize():void
		{
			_uiMaskEffect.stageResize();
		}		

		public static function getLineBox(width:int, height:int,colorArray:Array=null, arg4:Number=0.5, arg5:Number=1, arg6:Number=1):LineBox
		{
			var loc1:*=ObjectPool.getObject(LineBox);
			if (colorArray == null) 
			{
				colorArray = [16711680, 16776960];
			}			
			loc1.updateLine(width,height,colorArray);
			return loc1;
		}
		
		public static function disposeLineBox(arg1:LineBox):void
		{
			if (!arg1) 
			{
				return;
			}
			arg1.dispose();
			ObjectPool.disposeObject(arg1, LineBox);			
		}		
	}
}
